<style scoped>
  .echarts {
    width: calc(100vw - 320px);
    height: calc(100vh - 40px);
    margin-left: auto;
    margin-right: auto;
  }

  .el-main {
    margin-left: 0;
    padding: 0;
    height: calc(100vh - 40px);
  }

</style>
<template>
  <el-main @click='updataData'>
    <div class='echarts' ref='charts'></div>
  </el-main>
</template>
<script>
  export default {
    data() {
      return {
        sets:{

        }
      }
    },
    mounted() {
      const that = this;
      //获取后台设置的参数
      console.log(1);
      this.$http.get(that.$url + 'getParameters')
        .then(function (response) {
          that.sets = response.data;
          console.log(2);
        })
        .catch(function (error) {
          that.$message({
            message: '获取数据失败',
            type: 'error'
          });
        });
        console.log(3);
      console.log(that.sets);
      this.$http.get(that.$url + 'getRecentDayData')
          .then(function (response) {
            that.sets.a = response.data;
          })
          .catch(function (error) {
            
          });
      console.log(that.sets);
      console.log(4);
    },
    methods: {
      updataData() {

      }
    }
  }

</script>
